from typing import List


class Solution:
    def twoSum(self, nums: List[int], target: int) -> List[int]:
        hashtable = dict()
        for i, num in enumerate(nums):
            if target - num in hashtable:
                return [hashtable[target - num], i]
            hashtable[nums[i]] = i
        return []


test_nums = [2, 7, 11, 15]
teat_target = 9
res = Solution()
print(res.twoSum(test_nums, teat_target))

# class C(object):
#     @staticmethod
#     def f():
#         print('runoob');
#
#
# C.f();  # 静态方法无需实例化
# cobj = C()
# cobj.f()  # 也可以实例化后调用
